import request from './request'

export const getNodeList = () => {
  return request({
    url: '/fmms/nodeController/getNodeList',
    method: 'get'
  })
}

export const getNodeResourceList = (id) => {
  return request({
    url: `/fmms/nodeController/getNodeResourceList/${id}`,
    method: 'get'
  })
}

export const getSystemInfoAndSensorInfo = () => {
  return request({
    url: '/fmms/nodeController/getSystemInfoAndSensorInfo',
    method: 'get'
  })
}

export const getAnalysisData = () => {
  return request({
    url: '/fmms/nodeController/getAnalysisData',
    method: 'get'
  })
}

export const getNewStatusData = () => {
  return request({
    url: '/fmms/nodeController/getNewStatusData',
    method: 'get'
  })
}

export const exportExcel = () => {
  return request({
    url: '/fmms/dataDisplayController/exportExcel',
    method: 'get'
  })
}

export const acquireVideoUrl = () => {
  return request({
    url: '/fmms/videoController/acquireVideoUrl',
    method: 'get'
  })
}

export const getNodeManagerList = ({ pageNo, pageSize }, params) => {
  return request({
    url: `/fmms/nodeController/getNodeManagerList/${pageNo}/${pageSize}`,
    params,
    method: 'get'
  })
}

export const updateCurrentFacilityInfo = (data, id) => {
  return request({
    url: '/fmms/nodeController/updateCurrentFacilityInfo',
    params: { id },
    method: 'post',
    data
  })
}

export const addOrUpdateNodeListById = (data, id) => {
  return request({
    url: `/fmms/nodeController/addOrUpdateNodeListById/${id}`,
    method: 'put',
    data
  })
}

export const getFacilityNameList = (facility) => {
  return request({
    url: `/fmms/nodeController/getFacilityNameList/${facility}`,
    method: 'get'
  })
}

export const getNodeListById = (id) => {
  return request({
    url: `/fmms/nodeController/getNodeListById/${id}`,
    method: 'get'
  })
}

export const deleteFacilityById = (id) => {
  return request({
    url: `/fmms/nodeController/deleteFacilityById/${id}`,
    method: 'put'
  })
}
